#include "boost/program_options.hpp"
#include <iostream>
using namespace boost::program_options;
using namespace std;

namespace po = boost::program_options;

int main(int argc, char *argv[]) {
    try {
        po::options_description desc("Allowed options");
        // clang-format off
        desc.add_options()
            ("help", "produce help message")
            ("compression", po::value<int>(), "set compression level");
        // clang-format on
        po::variables_map vm;
        po::store(po::parse_command_line(argc, argv, desc), vm);
        po::notify(vm);

        if (vm.count("help")) {
            cout << desc << "\n";
            return 1;
        }

        if (vm.count("compression")) {
            cout << "Compression level was set to "
                 << vm["compression"].as<int>() << ".\n";
        } else {
            cout << "Compression level was not set.\n";
        }
    } catch (const boost::program_options::error &err) {
        std::cerr << err.what() << std::endl;
    }
    return 0;
}